package com.icangya.DAO.impl;
import com.icangya.DAO.IPayBeanDAO;
import com.icangya.domain.PayBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public class PayBeanDAOImpl extends  BaseDAO<PayBean> implements IPayBeanDAO {

    Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public List<PayBean> getPayBeanAll() {
        String hql="FROM PayBean pb ";
        List<PayBean> list=(List<PayBean>) getHibernateTemplate().find(hql);
        if(list.size()>0)
            return list;
        return null;
    }

    @Override
    public PayBean getPayBeanByStatus(String status) {
        String hql = "FROM PayBean pb where pb.status=?";
        List<PayBean> list = (List<PayBean>) getHibernateTemplate().find(hql, status);
        if (list.size() > 0)
            return list.get(0);
        return null;
    }
}
